<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = path + "/common/web/jsaward";
%>
<c:set var="path" value="<%=path%>"></c:set>
<c:set var="basePath" value="<%=basePath%>"></c:set>
<html>
<head>

<title>极速大夺宝</title>


<meta http-equiv="Expires" content="-1">               
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache"> 
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" type="text/css" href="${basePath}/css/jquery.mobile-1.4.2.min.css">
<link rel="stylesheet" type="text/css" href="${basePath}/css/basic.css" />
<link rel="stylesheet" type="text/css" href="${basePath}/css/common.css" />
<script type="text/javascript" src="${basePath}/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="${basePath}/js/jquery.mobile-1.4.2.min.js"></script>
<script type="text/javascript" src="${basePath}/js/base.js"></script>
<script type="text/javascript" src="${basePath}/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="${basePath}/js/global-1.1.0.min.js"></script>
</head>
<body>
    <div class="ui-page ui-page-theme-a ui-page-active" data-role="page" >
        <!-- main start -->
        <div class="wrapper">
         <div class="reward">
             <div class="reward-banner">
                <!-- 2016-12-5添加 -->
                 <div class="share">分享</div>
                 <div class="share-img"><img src="${basePath}/images/n_03.png" alt=""></div>
                 <a href="javascript:;" id="rwd-btn"><u>往期开奖记录</u></a>
                 <!-- 2016-12-5添加 -->
                 <img src="${basePath}/images/a_01.png" class="banner" alt="">
             </div>
             <!-- 2016-12-5修改 -->
             <div class="reward-top">
                 <div class="jc-box clearfix">
                     <img src="${basePath}/images/n_01.png" alt="" class="n_01">
                     <div class="jc clearfix">
                         <span><img src="${basePath}/images/n_02.png" alt=""></span>
                         <span>${shiwan}</span>
                         <span>${wan}</span>
                         <span>${qian}</span>
                         <span>${bai}</span>
                         <span>${shi}</span>
						 <span>${gewei}</span>
                     </div>
                 </div>
                 <div class="djs"> 
                     <!--    <span>开奖倒计时</span>
<!--                      <p> -->
<!--                          <em>10</em> -->
<!--                          : -->
<!--                          <em>21</em> -->
<!--                          : -->
<!--                          <em>35</em> -->
<!--                      </p> -->
<!--    <p id="daojs"> </p>-->
<p>周一至周五(工作日)16:00开奖
 </p>
                  </div> 
                  <a   onclick="goUrl();"  rel="external" class="reward-btn">抢抽奖号码</a>
                 <dl class="user-info clearfix">
                     <dt><img src="${basePath}/images/a_02.png" alt=""></dt>
                     <dd>
                         <div class="user-info-list clearfix">
                             <span>${jsAwardRecord.phone}</span>
                             <span>${jsAwardRecord.userName}</span>
                             <span>${jsAwardRecord.awardMoney}元</span>
                         </div>
                         <p>开奖金额视参与人数浮动</p>
                     </dd>
                 </dl>
             </div>
            <!-- 2016-12-5修改 -->
             <div class="reward-middle">
                 <img src="${basePath}/images/a_14.png" height="216" width="247" class="a_14" alt="">
                 <ul class="reward-middle-inner">
                     <li>
                         <img src="${basePath}/images/a_10.png" alt="">
                         <div class="txt-info">
                             <p>限贷速侠注册用户参与，每期从奖池随机发放的抽奖码中抽取一名中奖用户、若干名幸运用户。</p>
                         </div>
                     </li>
                     <li>
                         <img src="${basePath}/images/a_11.png" alt="">
                         <div class="txt-info">
                             <p>当用户完成以下四个中的任意一项，我们会向奖池里投入相当于抽奖码数量的金额，</p>
                             <p>每期中奖金额最高可达<em>10万元！！</em></p>
                             <img src="${basePath}/images/a_06.png" class="a_06" alt="">
                         </div>
                     </li>
                     <li>
                         <img src="${basePath}/images/a_12.png" alt="">
                         <div class="txt-info">
                             <p>活动时间: 2016年12月10日 — 2017年1月30日  开奖时间: 周一至周五(工作日)16:00开奖，开奖结果在本页公布</p>
                         </div>
                     </li>
                     <li>
                         <img src="${basePath}/images/a_13.png" alt=""><a href="javascript:;" id="role-btn">查看详细规则</a>
                         <div class="txt-info" style="margin-bottom:0;">
                             <img src="${basePath}/images/a_07.png" height="186" width="652"class="a_07" alt="">
                         </div>
                     </li>
                 </ul>
                <img src="${basePath}/images/a_16.png" alt="">
             </div>
             <div class="reward-foot">
                 <img src="${basePath}/images/a_09.png" alt="">
             </div>
            <div class="cover"></div>
            <!-- 开奖记录弹窗 -->
            <div class="tc-common" id="tc-01">
                <h2>开奖记录</h2>
                <img src="${basePath}/images/a_17.png" class="close" alt="">
                <div class="tab-box">
                <table>
                    <tbody id="drawAward">
                        <tr>
                            <td>期次</td>
                            <td>开奖时间</td>
                            <td>中奖码</td>
                        </tr>                    
                        
                    </tbody>
                </table>
                </div>
            </div>
            <!-- 开奖规则弹窗 -->
            <div class="tc-common" id="tc-02">
                <h2>开奖详细规则</h2>
                <img src="${basePath}/images/a_17.png" class="close" alt="">
                <div class="tab-box">
                 <h3>中奖者的产生是结合当日上证指数等一系列数学运算获得，公式如下</h3>
                 <img src="${basePath}/images/a_18.png" height="159" width="559" alt="">
                 <p>1、奖池的最后一个号码分配完毕后，将获取截止该时间点奖池的最后50个参与时间；将这50个时间的数值进行求和（得出数值A）（每个时间按时、分、秒、毫秒的顺序组合，如20:15:25.362则为201525362）；</p>
                 <p>2、为保证公平公正公开，系统还会等待一小段时间，取当天上证 A 指数结果（数值B）；（数值A+数值B）除以该奖池总需人次得到的余数 + 原始数 10000001，得到最终幸运号码，拥有该幸运号码者，直接拿走该奖池全额。</p>
                 <p>3、（如遇节假日，上证 A 指数未有变化，则默认为上一交易日的数值。）</p>
                </div>
            </div>

         </div>
          
        </div>
        <!-- main end -->
        
    </div>
    <script type="text/javascript">
    $(function () {
        $('#rwd-btn').click(function(event) {
            $('#tc-01,.cover').show();
            $('html,body').css('overflow-y','hidden');
        });
        $('#role-btn').click(function(event) {
            $('#tc-02,.cover').show();
            $('html,body').css('overflow-y','hidden');
        });
        $('.close').click(function(event) {
            $('#tc-01,#tc-02,.cover').hide();
            $('html,body').css('overflow-y','auto');
        });
        //分享2016-12-8
        $('.share').click(function(event) {
            $('.share-img').show();
            $('html,body').css('overflow-y','hidden');
        });
        $('.share-img').click(function(event) {
            $('.share-img').hide();
            $('html,body').css('overflow-y','auto');
        });
    });
    </script>
        <script type="text/javascript">
function PrefixInteger(num, length) {
return (Array(length).join('0') + num).slice(-length);
}
</script>
    <script type="text/javascript">
    //alert('${compareDate}');
   //  var EndTime1=new Date('${compareDate}');
    // alert(EndTime1);
    function GetRTime(){
        var EndTime=new Date('${compareDate}');
        var NowTime = new Date();
        var t =EndTime.getTime() - NowTime.getTime();
        var d=0;
        var h=0;
        var m=0;
        var s=0;
        if(t>=0){
          d=Math.floor(t/1000/60/60/24);
          h=Math.floor(t/1000/60/60%24);
          m=Math.floor(t/1000/60%60);
          s=Math.floor(t/1000%60);
        }
     
     
        document.getElementById("daojs").innerHTML = d + "天"+ h + "时"+m + "分"+s + "秒";
//         document.getElementById("t_h").innerHTML =;
//         document.getElementById("t_m").innerHTML = m + "分";
//         document.getElementById("t_s").innerHTML = s + "秒";
      }
   //  setInterval(GetRTime,0);
    </script>
     <script type="text/javascript">
     var isApp='${isApp}';
     var clientType='${clientType}';
     if(isApp=='1'){
    	 $('.share').hide(); 
     }
    
     function goUrl(){
    	 if(isApp=='1'){//代表app内部
    		
    		
    		 if(clientType=='andriod'){
    			 nativeMethod.toLotteryList();
    		 }else if(clientType=='ios'){
    			 window.location.href="http://www.daisuxia.com";
    		 }
    	 }
    	 else{
    		 window.location.href="${downUrl }";
    	 }
     }
     </script>
	<script type="text/javascript">
		var pageNum = 1;
		var datas = {
			"pageNo" : 1,
			"pageSize" : 1000
		};

		$.ajax({
			type : "POST",
			data : datas,
			url : '${ctx}/jsaward/awardCenterWeb/drawAwardList',
			//url:'${api}/jsaward/awardCenterWeb/drawAwardList',
			//url:'${api}/help/center/drawAwardList',
			success : function(data) {

				showFriendList(data);

			},
			error : function(data) {
				alert(data);
				alert("加载失败！");
			}
		});

		function showFriendList(data) {
			if (data.list.list.length > 0) {

				var htmlStr = '';
				$.each(data.list.list, function(i, pm) {

					if (pm.periods != null) {
						periods = pm.periods
					} else {
						periods = ""
					}
					if (pm.darwTime != null) {
						darwTime = pm.darwTime
						darwTime = new Date(darwTime).format("yyyy-MM-dd");
					} else {
						darwTime = ""
					}
					if (pm.drawrollsNumber != null) {
						drawrollsNumber = pm.drawrollsNumber
					} else {
						drawrollsNumber = ""
					}
					htmlStr += "<tr><td>" + periods + "</td><td>" + darwTime
					//  							toDate(data.addTime, 'yyyy-MM-dd ')
					+ "</td><td>" + drawrollsNumber + "</td></tr>"
				});
				$("#drawAward").append(htmlStr);

				//  						if(pageNum==1){
				//  							 $("#friendlist").append(htmlStr1);
				//  							 $("#friendlist").append(htmlStr);
				//  						}else{
				//  							 $("#friendlist").append(htmlStr);
				//  						}
				//  						if (pageNum == 1) {
				//  							$("#pageDiv")
				//  									.append(
				//  											'<a href="javascript:;" onclick="loadPage();" class="ui-btn ui-state-disabled">显示更多 > ></a>');
				//  						}

				// 						if (data.totalPage == data.currentPage) {
				//  							pageNum = data.totalPage;
				//  							$("#pageDiv").find("a").addClass("ui-state-disabled");
				//  							$("#pageDiv").find("a").html("没有更多了");
				//  						} else {
				//  							$("#pageDiv").find("a").removeClass("ui-state-disabled");
				//  						}
			} else {
				// 		 $("#yqjl").html("暂无邀请记录");
			}
		}
		// function loadPage() {
		// 	pageNum++;
		// 	openAjax('${path }/basics/friendPushMoney.do', {"pageNum":pageNum,'numPerPage' : 4}, showFriendList);
		// }
	</script>
</body>
</html>